import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useRefreshStore = defineStore('refresh', () => {
  const lastRefreshTime = ref(null)
  const refreshInterval = ref(5000) // 单位：毫秒
  const isRefreshing = ref(false)

  function triggerRefresh() {
    lastRefreshTime.value = new Date()
  }

  return { lastRefreshTime, refreshInterval, isRefreshing, triggerRefresh }
})
